package com.polaris.live.adapter.user_space

import android.widget.ImageView
import com.polaris.live.R
import com.polaris.live.resp.back_resp.UserOtherPhotoVo
import com.polaris.live.utils.image.ImageUtils
import com.polaris.live.utils.image.normal
import com.bumptech.glide.Glide
import com.zhpan.bannerview.BaseBannerAdapter
import com.zhpan.bannerview.BaseViewHolder

/**
 * RechargeBannerAdapter
 * 充值banner
 *
 * @author Created by 长空 on 2023/10/23/020 10:23
 */
class UserBannerAdapter : BaseBannerAdapter<UserOtherPhotoVo>() {

    override fun bindData(
        holder: BaseViewHolder<UserOtherPhotoVo>,
        data: UserOtherPhotoVo,
        position: Int,
        pageSize: Int
    ) {
        val imageView = holder.findViewById<ImageView>(R.id.item_banner)
        Glide.with(imageView.context).load(ImageUtils.imgPath(data.url)).normal().into(holder.findViewById(R.id.item_banner))
    }

    override fun getLayoutId(viewType: Int): Int {
        return R.layout.adapter_recharge_banner
    }

}